#ifndef WXSITEMRESDATAOBJECT_H
#define WXSITEMRESDATAOBJECT_H

#include <wx/dataobj.h>
#include <tinyxml.h>

#define wxsDF_WIDGET   _T("wxSmith XML")

class wxsItem;
class wxsItemResData;


class wxsItemResDataObject : public wxDataObject {
  public:


    wxsItemResDataObject();


    virtual ~wxsItemResDataObject();

    //=====================================
    // Operating on data


    void Clear();


    bool AddItem( wxsItem* Item );


    int GetItemCount() const;


    wxsItem* BuildItem( wxsItemResData* Data, int Index = 0 ) const;


    bool SetXmlData( const wxString& Data );


    wxString GetXmlData() const;

    //=====================================
    // Members of wxDataObject class


    virtual void GetAllFormats( wxDataFormat *formats, Direction dir ) const;


    virtual bool GetDataHere( const wxDataFormat& format, void *buf ) const;


    virtual size_t GetDataSize( const wxDataFormat& format ) const;


    virtual size_t GetFormatCount( Direction dir ) const;


    virtual wxDataFormat GetPreferredFormat( Direction dir ) const;


    virtual bool SetData( const wxDataFormat& format, size_t len, const void *buf );

  private:

    TiXmlDocument m_XmlDoc;
    TiXmlElement* m_XmlElem;
    int m_ItemCount;
};

#endif
